/* Author : Maisa Nurul Agnia */
package jtk.project4.fleet.field;

import jtk.project4.fleet.domain.Po;
import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.CalendarControl;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.ComboField;
import nl.coderight.jazz.form.field.TextField;

public class DataBuyerField extends GroupControl<Po>{
	private CalendarControl dateField; //tipe data date
	private TextField poField;
	private CalendarControl dateRequiredField; // tipe data date
	private ComboField<String> buyerNameField;
	private ComboField<String> shipViaField;
	
	public DataBuyerField(String bindID){
		//setTitle("header.PurchasedFrom(Vendor)"); //disesuaikan dengan nama field
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	private void createFields()
	{
		poField = new TextField("poNo",20);
		
		dateField = new CalendarControl("Calendar",20);
		dateField.setPreferredSize(poField.getPreferredSize());
		
		dateRequiredField = new CalendarControl("Calendar",20);
		dateRequiredField.setPreferredSize(poField.getPreferredSize());
		
		buyerNameField = new ComboField <String> ("buyerName","bN");
		buyerNameField.setPreferredSize(poField.getPreferredSize());
		
		shipViaField = new ComboField <String> ("shipVia","sV");
		shipViaField.setPreferredSize(poField.getPreferredSize());
				
	}
	
	private void createLayout()
	{
		setLayout(new FormLayout())

		.addLabel("label.Date")			.addField(dateField)
		.addRow()
		.addLabel("label.PO#") 			.addField(poField)
		.addRow()
		.addLabel("label.DateRequired")	.addField(dateRequiredField)
		.addRow()
		.addLabel("label.BuyerName")	.addField(buyerNameField)
		.addRow()	
		.addLabel("label.ShipVia")		.addField(shipViaField)
		.addRow()
		.addRow()
	;
	}

}
